//
//  BBSideItemCell.m
//  BabyThermometer
//
//  Created by CaiLei on 10/3/14.
//  Copyright (c) 2014 baohu. All rights reserved.
//

#import "BBSideItemCell.h"

@implementation BBSideItemCell {
    BOOL _bSetupDone;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setupUI];
    }
    return self;
}

//- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {
//    if (highlighted) {
//        self.iconImageView.image = [UIImage imageNamed:self.highlightIconName];
//    } else {
//        self.iconImageView.image = [UIImage imageNamed:self.normalIconName];
//    }
//    [self setNeedsDisplay];
//    [super setHighlighted:highlighted animated:animated];
//}

- (void)awakeFromNib
{
    [self setupUI];
}

- (void)setupUI {
    _bSetupDone = NO;
    self.iconImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
    self.iconImageView.contentMode = UIViewContentModeCenter;
    self.nameLabel = [[UILabel alloc] initWithFrame:CGRectZero];
    self.nameLabel.font = [UIFont systemFontOfSize:15];
    self.nameLabel.textColor = [UIColor colorWithHexString:@"618eb4"];
    //self.nameLabel.textColor = [UIColor redColor];
    [self.contentView addSubview:self.iconImageView];
    [self.contentView addSubview:self.nameLabel];
    
    self.backgroundColor = [UIColor clearColor];
    _bSetupDone = YES;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.iconImageView.frame = CGRectMake(50, 0, 22, self.contentView.frame.size.height);
    self.nameLabel.frame = CGRectMake(90, 0, self.contentView.frame.size.width - 80, self.contentView.frame.size.height);
}

@end
